import { toRaw } from 'vue'
/** 返回去除'_'开头属性的新对象*/
export const excludeUnderscoreProps = <T extends object>(obj: T): Omit<T, `_${string}`> => {
  return Object.entries(obj).reduce((acc, [key, value]) => {
    if (!key.startsWith('_')) {
      acc[key] = toRaw(value)
    }
    return acc
  }, {}) as Omit<T, `_${string}`>
}
